package com.frogs.ucenter.v1.request;

import javax.servlet.http.HttpServletRequest;

import com.frogs.framework.web.HttpRequestInfo;
import com.frogs.system.util.ApiUrlParamEnum;
import com.frogs.system.web.exception.RequestIllegalException;
import com.frogs.system.web.api.request.Request;

public class UserShippingAddressDeleteRequest extends Request {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = -9154119156018130897L;

	private int id = 0;
	
    private int userId = 0;

	/** */
	public UserShippingAddressDeleteRequest() {
	}

	@Override
	public void parse(HttpServletRequest request) {
		
		HttpRequestInfo requestInfo = new HttpRequestInfo(request);
		
		
		this.id = requestInfo.getIntParameter(ApiUrlParamEnum.userShippingAddressId.getParamName(), -1);
		if ( id <1 ) {
			throw new RequestIllegalException("error id:"+id);
		}
		
		this.userId = requestInfo.getIntParameter(ApiUrlParamEnum.userId.getParamName(), -1);
		if ( userId <1 ) {
			throw new RequestIllegalException("error userId:"+userId);
		}
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public int getUserId() {
		return userId;
	}

	public void setUserId(int userId) {
		this.userId = userId;
	}

}
